#ifndef __MYAPP_H__INCLUDED__
#define __MYAPP_H__INCLUDED__

#include <gtk/gtk.h>

static const char APPNAME[] = "gSpeedyAlert";
// eshabe - 2009-09-10 : telkom ganti interface
//static const char DEF_ALERTURL[] = "http://portal.telkomspeedy.com/divre1/speedyalertbtm/terima.php?noadsl=";
static const char DEF_ALERTURL[] = "http://infousage.telkomspeedy.com/dev/ci/alert/usage_bar_new_alert/";

static const char CONFIG_FILENAME[] = "/.myspeedy-0.4";

// maksimal besar reply (yg diambil) dari server: (100 KB)
#define MAXREPLY 1024*100
// maksimal pesan yg diambil
#define MAXMESSAGE 256

typedef struct labels
{
  GtkWidget *lblSpeedy;
  GtkWidget *lblQuota;
  GtkWidget *lblPenggunaan;
  GtkWidget *lblSisaQuota;
  GtkWidget *lblSisaTxt; // eshabe - 2009-05-27 - add
} labels;

typedef struct userinfo
{
  char speedynumber[16];
  char alerturl[128];
  int checkinterval;
  int limit2alert;
} userinfo;


typedef struct usageinfo
{
    char quota[32]; // eshabe: 20 --> 32. 20 masalah jika quota jam (20090401-1)
    char penggunaan[32]; // (20090401-1)
    char sisa[32]; // (20090401-1)
    char kelebihan[32]; // (20090916-1)
    float penggunaan_persen;

} usageinfo;

int http_get (const char *url, const char *cookies, char *reply);
int getdata(const char *url, usageinfo *ui, char *msg);
int geturl (const char *url, const char *nospeedy, char *result);
int login (const char *url, const char *user, const char *pwd, char *result);

void save_mykeys (GKeyFile *key, userinfo *uri);
void read_mykeys (userinfo *uri);

#endif
